using System;
using System.Threading;
using UnityEngine;

public class Chapter03_10_5_Awaitable4 : MonoBehaviour
{
    private CancellationTokenSource TokenSource;

    private async void Start()
    {
        TokenSource = new CancellationTokenSource();
		try
		{
			await Awaitable.WaitForSecondsAsync(1, TokenSource.Token);
        }
		catch (OperationCanceledException)
		{

		}
    }

    private void Cancel()
    {
        TokenSource?.Cancel();
        TokenSource?.Dispose();
    }
}

